import request from "@/utils/request";

const apiPrefix = "/admin/system/sysUser";

export function getPageList(page, limit, searchObj) {
  return request({
    url: `${apiPrefix}/${page}/${limit}`,
    method: "get",
    params: searchObj,
  });
}

export function add(user) {
  return request({
    url: `${apiPrefix}/save`,
    method: "post",
    data: user,
  });
}

export function updateById(user) {
  return request({
    url: `${apiPrefix}/update`,
    method: "post",
    data: user,
  });
}

export function deleteById(id) {
  return request({
    url: `${apiPrefix}/remove/${id}`,
    method: "delete",
  });
}

export function batchDelete(ids) {
  return request({
    url: `${apiPrefix}/batchRemove`,
    method: "delete",
    data: ids,
  });
}

export function updateStatus(id, status) {
  return request({
    url: `${apiPrefix}/updateStatus`,
    method: "get",
    params: { id, status },
  });
}
